// ZoomButton.h
#ifndef ZOOMBUTTON_H
#define ZOOMBUTTON_H

#include <QPushButton>
#include <QSize>
#include <string>

class ZoomButton : public QPushButton
{
    Q_OBJECT // 必须包含这个宏以支持信号和槽

        public : ZoomButton(QWidget *parent, std::string name, bool W_flag, bool H_flag);
    ~ZoomButton();

signals:
    void sizeChanged(std::string &name, int width, int height); // 声明信号

public:
    void SetDay();
    void SetNight();

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;

public:
    std::string _name;

private:
    QWidget *_parent;
    bool _w_flag;
    bool _h_flag;
    bool m_dragging = false;
    QPoint m_lastPos;
};

#endif // ZOOMBUTTON_H